import fetch from '@/api'

//列表
export function getDepositReceiptList(params) {
    return fetch({
        method: 'get',
        url: `/stockBill/page`,
        params,
    })
}
// 上账
export function addAccount(data) {
    return fetch({
        method: 'post',
        url: `/stockBill/account`,
        data
    })
}

// 创建存单
export function addDepositReceipt(data) {
    return fetch({
        method: 'post',
        url: `/accept/conversion`,
        data
    })
}

// 编辑
export function updateDepositReceipt(id,data) {
    return fetch({
        method: 'post',
        url: `/stockBill/update/${id}`,
        data
    })
}

// 查询匹配上账
export function getDepositReceiptDetail(data) {
    return fetch({
        method: 'post',
        url: `/stockBill/get/match`,
        data
    })
}
// // 删除
// export function deleteDepositReceipt(entrustNo) {
//     return fetch({
//         method:'delete',
//         url:`/entrust/${entrustNo}`
//     })
// }

//提交
export function submitDepositReceipt(id, data) {
    return fetch({
        method: 'put',
        url: `/stockBill/${id}`,
        data,
    })
}

// 退回
export function rebackDepositReceipt(id, data) {
    return fetch({
        method: 'post',
        url: `/stockBill/return/${id}`,
        data,
    })
}
